﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AppSettingsLib
{
	public class AppSettingsManager
	{
        private AppSettings m_defaultSettings = null;
        private AppSettings m_userSettings = null;

        //--------------------------------------------------------------------------------
        /// <summary>
        /// Get the default settings object
        /// </summary>
        public AppSettings DefaultSettings
        {
            get { return m_defaultSettings; }
        }
		//--------------------------------------------------------------------------------
		/// <summary>
		/// Get the user settings object
		/// </summary>
		public AppSettings UserSettings
		{
			get { return m_userSettings; }
		}

		//--------------------------------------------------------------------------------
		/// <summary>
		/// Constructor
		/// </summary>
        public AppSettingsManager()
		{
            // create the default settings first
            m_defaultSettings = new AppSettings("DEFAULT_SETTINGS", null);
            m_defaultSettings.Load();
            // so we can pass them to the user settings for initial setup
            m_userSettings = new AppSettings("USER_SETTINGS", m_defaultSettings.XElement);
            m_userSettings.Load();
		}
	}
}

